<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
      
<h:head>
	<title>Modifica Voli</title>
	<link href="resources/css/main.css" rel="stylesheet" type="text/css" />
</h:head>  
<h:body>
	<header>
		<a><h:link class="logo" outcome="index" /></a>
	</header>
	<div id="container">
		<div id="content1">
			<div id="contentLarge">
	<h:form id="form" onsubmit="#{beanProdottoBase.retrieveVoli()}">
		
		<p:growl id="messages" showDetail="true"/>
		
		<p:dataTable id="dataTableVoli" var="voli" value="#{beanProdottoBase.listaVoli}" widgetVar="voliTable"   
		            emptyMessage="Nessun volo trovato per i parametri specificati." rowKey="#{voli.codice}"
		            editable="true" filteredValue="#{Retriever.voliFiltrati}">
		            
		            
		  		<f:facet name="header">
          			 Cerca, modifica ed elimina voli 
        		</f:facet> 
        		
        		<p:ajax event="rowEdit" listener="#{beanProdottoBase.updateVolo}" update=":form:messages" />  
       			<p:ajax event="rowEditCancel" listener="#{beanProdottoBase.deleteVolo}" update=":form:messages" />
		  
		  		
		  		
		        <p:column id="cittaPartenzaVolo" filterBy="cittaPartenza"   
		                headerText="Citta di partenza"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{voli.cittaPartenza}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{voli.cittaPartenza}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>  
		  
		        <p:column id="aeroportoPartenzaVolo" filterBy="aeroportoPartenza"  
		                headerText="Aeroporto di partenza"
		                filterMatchMode="contains">
		                <p:cellEditor>  
                		<f:facet name="output">  
		            		<h:outputText value="#{voli.aeroportoPartenza}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{voli.aeroportoPartenza}" style="width:30%"/>
                		</f:facet>  
            		</p:cellEditor> 
		        </p:column>  
		  
		  		<p:column id="cittaArrivoVolo" filterBy="cittaArrivo"  
		                headerText="Citta di arrivo" filterMatchMode="contains">  
		            
		            <p:cellEditor>  
                		<f:facet name="output">  
		            		<h:outputText value="#{voli.cittaArrivo}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{voli.cittaArrivo}"/>
                		</f:facet>  
            		</p:cellEditor>
		        </p:column>
		        
		        <p:column id="aeroportoArrivoVolo" filterBy="aeroportoArrivo"   
		                headerText="Aereoporto di arrivo"
		                filterMatchMode="contains">  
		            
		            <p:cellEditor>  
                		<f:facet name="output">  
		            		<h:outputText value="#{voli.aeroportoArrivo}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{voli.aeroportoArrivo}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>  
		        
		        <p:column id="dataVolo" filterBy="data"   
		                headerText="Data di partenza"
		                filterMatchMode="contains">  
		            
		            <p:cellEditor>  
                		<f:facet name="output">  
		            		<h:outputText value="#{voli.data}" />  
                		</f:facet>  
                		<f:facet name="input">
                			<p:calendar pattern="MM/dd/yyyy HH:mm"  value="#{voli.data}" id="data" mindate="#{beanProdottoBase.dataOdierna}" >
								<p:ajax event="dateSelect" update="dataRitorno"/>
							</p:calendar>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="dataRitornoVolo" filterBy="dataRitorno"   
		                headerText="Data di ritorno"
		                filterMatchMode="contains">  
		            
		            <p:cellEditor>  
                		<f:facet name="output">  
		            		<h:outputText value="#{voli.dataRitorno}" />  
                		</f:facet>  
                		<f:facet name="input">
                			<p:calendar pattern="MM/dd/yyyy HH:mm"  value="#{voli.dataRitorno}" id="dataRitorno" mindate="#{voli.data}"/>
                		</f:facet>
                		 
            		</p:cellEditor>  
		        </p:column>
		        
<!-- 		        <p:column id="durataVolo" filterBy="durata"    -->
<!-- 		                headerText="Durata" -->
<!-- 		                filterMatchMode="contains">   -->
		            
<!-- 		            <p:cellEditor>   -->
<!--                 		<f:facet name="output">   -->
<!-- 		            		<h:outputText value="#{voli.durata}" />   -->
<!--                 		</f:facet>  -->
<!--                 		<f:facet name="input"> -->
<!--                 			<h:inputText value="#{voli.durata}"/> -->
<!--                 		</f:facet>   -->
<!--             		</p:cellEditor>   -->
<!-- 		        </p:column> -->
		        
<!-- 		        <p:column id="oraPartenzaVolo" filterBy="oraPartenza"    -->
<!-- 		                headerText="Ora di partenza" -->
<!-- 		                filterMatchMode="contains">   -->
		            
<!-- 		            <p:cellEditor>   -->
<!--                 		<f:facet name="output">   -->
<!-- 		            		<h:outputText value="#{voli.oraPartenza}" />   -->
<!--                 		</f:facet>   -->
<!--                 		<f:facet name="input">   -->
<!--                     		<p:inputText value="#{voli.oraPartenza}"/> -->
<!--                 		</f:facet>   -->
<!--             		</p:cellEditor>   -->
<!-- 		        </p:column> -->
		        
		        <p:column id="posti_DisponibiliVolo" filterBy="posti_Disponibili"   
		                headerText="Posti disponibili"
		                filterMatchMode="contains">  
		            
		            <p:cellEditor>  
                		<f:facet name="output">  
		            		<h:outputText value="#{voli.posti_Disponibili}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{voli.posti_Disponibili}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="prezzo" filterBy="prezzo"   
		                headerText="Prezzo"
		                filterMatchMode="contains">  
		            
		            <p:cellEditor>  
                		<f:facet name="output">  
		            		<h:outputText value="#{voli.prezzo}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{voli.prezzo}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column style="width:6%">  
           			<p:rowEditor />  
        		</p:column>
		          
		    </p:dataTable>
	</h:form>	
	</div>
	</div>
	<a><h:link class="button1" outcome="creaProdottoBase" value="Indietro"/></a>
	</div>
		<h:outputStylesheet library="css" name="main.css"/>  
</h:body>
       
</html>